home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / alsa-base.preinst < prev    next >
Text File  |  2008-09-15  |  915b  |  40 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. # Prepare to move a conffile without triggering a dpkg question
  6. prep_mv_conffile() {
  7.     CONFFILE="$1"
  8.  
  9.     if [ -e "$CONFFILE" ]; then
  10.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  11.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`"
  12.         if [ "$md5sum" = "$old_md5sum" ]; then
  13.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  14.         fi
  15.     fi
  16. }
  17.  
  18. case "$1" in
  19.   install|upgrade)
  20.     # The following must be deleted at preinst time
  21.     # so that dpkg can remove their parent directories
  22.     # Delete obsolete dev.d symlinks
  23.     for N in 0 1 2 3 4 5 6 7 ; do
  24.         D="/etc/dev.d/snd/controlC$N"
  25.         if [ -d "$D" ] ; then
  26.             L="$D/alsa-base.dev"
  27.             rm -fv "$L"
  28.         fi
  29.     done
  30.     # Delete obsolete dev.d script
  31.     rm -fv /etc/alsa/dev.d/alsa-base
  32.     # Delete obsolete init script
  33.     rm -fv /etc/init.d/alsa
  34.     ;;
  35. # abort-upgrade)
  36. esac
  37.  
  38.  
  39.  
  40.